package com.winspread.app.paging

import androidx.paging.Pager
import androidx.paging.PagingConfig
import androidx.paging.PagingData
import kotlinx.coroutines.flow.Flow

/**
 *Author: Amin
 *Data: 2023/4/12 14:17
 *
 *Description:
 *
 */
object Repository {

    private const val PAGE_SIZE = 15

    private val gitHubService = GitHubService.create()

    fun getPagingData(): Flow<PagingData<Repo>> {
        return Pager(config = PagingConfig(PAGE_SIZE), pagingSourceFactory = { RepoPagingSource(gitHubService) }).flow
    }


}